home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
madtrb4.arc
/
GETFREE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1984-12-18
|
1KB
|
32 lines
{@@@@@@@@@@@ copyright (C) 1984 by Neil J. Rubenking @@@@@@@@@@@@@@@@@@@@@@@@
The purchaser of these procedures and functions may include them in COMPILED
programs freely, but may not sell or give away the source text.
}
{$I regpack.typ}
{$I getfree.lib}
{$I getsetdd.lib}
var
OK : boolean;
drv : char;
HowMuch : real;
begin
repeat
Write('Enter drive to check -- just <enter> for current :');
read(drv);
WriteLn;
until UpCase(drv) in [#26,'A'..'D']; { for some reason, if you just <enter>
in response to a READ of a CHAR,
character #26 is received }
if drv = #26 then drv := '@' { GetFree uses "@" to represent the current
drive because it comes just before "A" in
the ASCII order. }
else drv := UpCase(drv);
GetFree(drv,HowMuch,OK);
if OK then
begin
if drv = '@' then GetSetDrive('G',drv);
Write(HowMuch:1:0,' bytes free on drive ',drv);
end
else WriteLn('Invalid drive');
end.